package com.File_io_.io_.writer_;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author 宋鑫宇
 * @version 1.0
 */
public class FileWriter_ {
    public static void main(String[] args) {
        FileWriter fileWriter = null;
        String str = "风雨之后，彩虹将至";
        try {
            fileWriter = new FileWriter("D:\\idea_WorkSpace\\myjava\\myjava\\src\\com\\File_io_\\hello.txt", true);
            fileWriter.write(str, 0, str.length());
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fileWriter != null) {
                try {
                    fileWriter.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
